<?php $this->_extends('_layouts/admin/main_layout'); ?>

<?php $this->_block('resource'); ?>

<?php $this->_endblock(); ?>

<?php $this->_block('title'); ?>
	Html Templates
<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>

<div id="content" class="box">
	<h1>Jquery Plugins类别</h1>
	
	<fieldset>
		<legend id="area">分类</legend>
		<ul class="formErrors">
			<?php $formErrors = $typeModel->getValidateError(); if(!empty($formErrors)): ?>
				<?php foreach($formErrors as $item => $errors): ?>
					<li>
						<?php echo $item; ?>
						<ul>
							<?php foreach($errors as $error): ?>
								<li class="error"><?php echo $error; ?></li>
							<?php endforeach; ?>
						</ul>
					</li>
				<?php endforeach; ?>
			<?php endif; ?>
		</ul>
		<form action="<?php echo url('adminjqueryplugins/type', array('ope' => 'add')); ?>" method="post">
			<input type="hidden" name="whichType" value="area" />
			<span>名称(Zh)：</span>
			<input name="name" />&nbsp;&nbsp;
			<span>名称(En)：</span>
			<input name="name_en" />&nbsp;&nbsp;
			<input type="submit" value="添加" />
		</form>
		<table class="full-size" style="text-align: center;">
			<thead>
				<tr>
					<th>名称(Zh)</th>
					<th>名称(En)</th>
					<th>默认值</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<?php if(!empty($types)): foreach($types as $jq_t): ?>
					<tr>
						<td><?php echo $jq_t['name']; ?></td>
						<td><?php echo $jq_t['name_en']; ?></td>
						<td><?php echo ($jq_t['is_default'] == 1)? '是' : ''; ?></td>
						<td>
							<a href="<?php echo url('adminjqueryplugins/type', array('ope' => 'delete', 'id' => $jq_t['id'], 'whichType' => 'area')); ?>">删除</a>
							<a href="<?php echo url('adminjqueryplugins/type', array('ope' => 'setdefault', 'id' => $jq_t['id'], 'whichType' => 'area')); ?>">设为默认</a>
						</td>
					</tr>
				<?php endforeach; endif; ?>
			</tbody>
		</table>
	</fieldset>
	
</div>
<?php $this->_endblock(); ?>